package reflect;

/**
 * 使用当前类来测试反射机制
 */
@AutoRunClass
public class Person {
    private String name;
    private int age;

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public Person() throws ClassNotFoundException {
    }

    public Person(String name) throws ClassNotFoundException {this.name = name;}


    public void sayHello(){
        System.out.println(name+":hello!");
    }



    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }

    @AutoRunMethod(value = 5,name = "张三")
    public void sayHi(){
        System.out.println(name+":hi");
    }
    @AutoRunMethod(value = 4,name = "李四")
    public void doSome(){
        System.out.println(name+":做某事");
    }
    @AutoRunMethod(value = 3,name = "王五")
    public void sleep(){
        System.out.println(name+":睡觉");
    }
    @AutoRunMethod(name = "啦啦啦")
    public void watchTV(){
        System.out.println(name+":看电视");
    }
    public void study(){
        System.out.println(name+":在学习");
    }
    public void playGame(){
        System.out.println(name+":在打游戏");
    }
    public void sing(){
        System.out.println(name+":在唱歌");
    }
    public void say(String info){
        System.out.println(name+":"+info);
    }
    public void say(String info,int connt){
        for (int i = 0; i < connt; i++) {
            System.out.println(name+":"+info);
        }
    }
    private void hehe(){
        System.out.println("我是person的私有方法hehe()!");
    }






























}
